<template>
    <div>
        <div>{{value}}</div>
        <input v-model="title" />
        <button @click="comfirm">确定</button>
    </div>
</template>
<script>
export default {
    props: {
        value: String
    },
    watch: {
        value(newVal, oldVal){
            console.log(newVal, oldVal)

            this.$emit('input', newVal)
        }
    },
    data () {
        return{
            num: 1,
            title: ''
        }
    },
    methods: {
        comfirm(){
           
            this.$emit('input', this.title)
        }
    }
}
</script>
<style scoped>

</style>